#define _CRT_SECURE_NO_WARNINGS

#include<stdio.h>

int DigitSum(int n)
{
	 int ret = n % 10;
	int sum = 0;
	if (n / 10 == 0) 
		return n;
	else
	{
		sum = sum +  ret + DigitSum(n/10);
		return sum;
	}

}
int main()
{
	int n = 0;
	scanf("%d", &n);
	DigitSum(n);
	int num = DigitSum(n);
	printf("%d", num);
	return 0;
}